#!/usr/bin/env bash
. /deploy/.func.sh
export ROOT_DIR=${ROOT_DIR:-"/app/server"}
cd ${ROOT_DIR}
rm -fr /var/www/html
mkdir -p /var/www
ln -s ${ROOT_DIR} /var/www/html
sed -i 's/user = apache/user = root/' /etc/php-fpm.d/www.conf
sed -i 's/group = apache/group = root/' /etc/php-fpm.d/www.conf
sed -i 's/php-fpm --daemonize/php-fpm -R --daemonize/' /etc/init.d/php-fpm
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' /etc/php.ini
echo "clear_env = no" >> /etc/php-fpm.d/www.conf
/etc/init.d/php-fpm start
nginx
run "启动[PHP_ENTRY]" ${PHP_ENTRY:-"/deploy/pass.sh"}
